﻿using DDD.Core.CQRS;
using MySqlConnector;
using System.Data;

namespace DDD.Application.DBConnectionFactory
{
    internal sealed class MySqlDBConnectionFactory : IDBConnectionFactory
    {
        private readonly string _connectionString;

        public MySqlDBConnectionFactory(string connectionString)
        {
            _connectionString = connectionString;
        }

        public IDbConnection GetDbConnection() =>
             new MySqlConnection(_connectionString);
    }
}
